<h1>Factorial</h1>

<ul>
<li> <a href="#1">Example</a>
<li> <a href="#2">Code</a>
<li> <a href="#3">Author</a>
</ul>

<a name="1"></a><h2>Example</h2>
<p>
(KNIT programmers can  run this example using <em>cd quill; make eg09</em>.) 
</p>
<p>
Input... 
</p>
<pre>
  for(I=1;I&lt;=20;I++) 
     print I " " factorial(I) 
</pre>
<p>
Output... 
</p>
<pre>
  1  1
  2  2
  3  6
  4  24
  5  120
  6  720
  7  5040
  8  40320
  9  362880
  10 3628800 
  11 39916800
  12 479001600
  13 6227020800
  14 87178291200
  15 1307674368000
  16 20922789888000
  17 355687428096000
  18 6402373705728000
  19 121645100408832000
  20 2432902008176640000
</pre>
<a name="2"></a><h2>Code</h2>
<pre>
 function factorial(n,  out,i) {
     if (n &lt; 1) 
         return 1;
     out = 1
     for(i=2;i&lt;=n;i++) 
         out *= i
     return out
 }
</pre>
<a name="3"></a><h2>Author</h2>
<p>
Tim Menzies
